#include <asm.h>
#include <csr.h>
ENTRY(setup_exception)
  /* TODO: 
   * save exception_handler_entry into STVEC
   * enable global exceptions */
  la  t0, exception_handler_entry
  csrrw  t0, CSR_STVEC, t0 /*the mode part of stvec is Direct(0b00)*/
  li  t0, SIE_SSIE | SIE_STIE | SIE_SEIE
  csrw  CSR_SIE, t0
  ret
  
ENDPROC(setup_exception)
